import joblib

# MODEL = 'movie.plk'
# PATH = "C:\\Users\\Administrator\\Desktop\\data"
# knn = joblib.load(f'{PATH}\\{MODEL}')
#
# tag_map = {0: '爱情', 1: '动作'}
# db_data = [
#     {'name': '未知电影1', 'love': 30, 'beat': 5},
#     {'name': '未知电影2', 'love': 60, 'beat': 7},
#     {'name': '未知电影3', 'love': 9, 'beat': 40},
#     {'name': '未知电影4', 'love': 7, 'beat': 50}
# ]
#
# last_data = list(map(lambda line: [line['love'], line['beat']], db_data))
# y_pred = knn.predict(last_data)
# result_list = list(map(lambda v: tag_map[v], y_pred))
# print(result_list)
#
